Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Lotus Expeditor wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL forums and blogs
  • Home
  • Product Documentation
  • Community Articles
Search
Community Articles > Expeditor Client for Desktop > Sample: Variable Substitution
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

Sample: Toolbar and Menu Contributions

Expeditor user interface team best practices on toolbar and menu contributions

Sample: Component Properties

OverviewComponent properties allow developers to create code that at compile time has specific function but accepts flexible input at runtime. For example, a developer can create a component that uses a predefined component property to update the title tab's text within a composite ...

Sample: Multiuser Features

Overview When multiple users share the same workstation, the configuration is referred to as a multiuser installation. This means that a single Expeditor client exists and is shared among all users; however, each user has their own workspace containing configuration details specific to that ...

Sample: Starting Plugins

Overview By default, Eclipse plugins are lazy. Lazy is the technical term (located in the bundle's manifest) that means that plugins are started when a request is either directly made by the Platform to start the plugin or indirectly through class loading. For example, the latter case implies ...

Sample: HTTP Communication

Overview The enhanced HTTP client in Expeditor allows developers to quickly create code that requests data from remote servers over HTTP or HTTPS. The enhanced client wraps the standard Java URLConnectionclasses such that authenticated requests leverage the Accounts framework and HTTPS ...
Community articleSample: Variable Substitution
Added by ~Tip Desachekli | Edited by ~Tip Desachekli on May 12, 2011 | Version 6
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
This sample supplements the "Using Dynamic Variable Substitution in Composite Applications" found on the IBM Composite Applications Wiki.
Tags: samples
ShowTable of Contents
HideTable of Contents
  • 1 Overview
  • 2 Create the Extension
  • 3 Create the Substitution Logic
  • 4 Using Substitution

Overview


The Using Dynamic Variable Substitution in Composite Applications article demonstrates how variable substitution can be used during runtime to dynamically supply information to Composite Applications. This article demonstrates the extension point that allows substitution to occur.

Create the Extension


Add the org.eclipse.core.variables plugin to the dependency list. The org.eclipse.core.variables supplies the org.eclipse.core.variables.dynamicVariables extension point used to add your own variable substitution logic.

Extend and add your own substitution logic by adding the following extension.

<extension
         point="org.eclipse.core.variables.dynamicVariables">
      <variable
            description="Resolves variables for eclipse preferences.  The argument is of the format {$IBM:<pluginId>/<preferenceName>}."
            name="IBM"
            resolver="com.ibm.rcp.support.variables.dynamic.DynamicVariableResolver"
            supportsArgument="true">
      </variable>
   </extension>


Create the Substitution Logic


Next, implement the logic that will perform the substitution by implementing the IDynamicVariableResolver interface. This class should be referenced in the resolver element used in the extension described previously.

public class DynamicVariableResolver implements IDynamicVariableResolver {

	@Override
	public String resolveValue(IDynamicVariable variable, String argument)
			throws CoreException {

		String[] args = argument.split("/");

		// variables are of the form
		// {$IBM:<pluginId>/<preferenceName>}
		String plugin = args[0];
		String preference = args[1];

		// do some logic to substitute
		if (preference.equals("ibm_url")) {
			return "http://www.ibm.com";
		}

		return null;
	}
}


Using Substitution


Similar to the Using Dynamic Variable Substitution in Composite Applications, add a Managed Browser component to a Composite Application. Update the intialUrl component property to the value ${IBM:com.ibm.rcp.support.variable.dynamic/ibm_url}.



When the Managed Browser component initiatlizes, the substitution code will supply the http://www.ibm.com value.

  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (6)
collapsed Versions (6)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (6)May 12, 2011, 2:47:47 PM~Tip Desachekli  
5Nov 1, 2010, 6:22:06 PM~Tip Desachekli  
4Nov 1, 2010, 6:16:36 PM~Tip Desachekli  
3Nov 1, 2010, 5:59:51 PM~Tip Desachekli  
2Nov 1, 2010, 4:46:26 PM~Tip Desachekli  
1Nov 1, 2010, 4:45:47 PM~Tip Desachekli  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software Support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL Software
  • Privacy
  • Accessibility